# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html

import scrapy
import datetime
from scrapy.loader.processors import MapCompose


class ArticlespiderItem(scrapy.Item):
    # define the fields for your item here like:
    # name = scrapy.Field()
    pass

def date_convert(value):
    try:
        create_date = datetime.datetime.strptime(value, "%Y/%m/%d").date()
    except Exception as e:
        create_date = datetime.datetime.now().date()



class SinaNewsArticleItem(scrapy.Item):
    title = scrapy.Field()


class SinaNewsItem(scrapy.Item):
    url = scrapy.Field()
    title = scrapy.Field()
    content = scrapy.Field()
    creat_time = scrapy.Field()
    creat_date = scrapy.Field()
    #url_object_id = scrapy.Field()
    keyword = scrapy.Field()
    data_source = scrapy.Field()


class SinabotItem(scrapy.Item):
    url = scrapy.Field()
    Head = scrapy.Field()
    Content = scrapy.Field()
    creat_date = scrapy.Field()
    creat_time = scrapy.Field()

